//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#ifndef _PRIMITIVEGROUP_H
#define _PRIMITIVEGROUP_H
#include <global.h>
#include <QList>
#include <QString>
#include "uierror.h"
class Primitive;
class Document;
typedef QList<Primitive*> PrimitiveList;
//
class PrimitiveGroup {
public:
   PrimitiveGroup(Document *doc);
   ~PrimitiveGroup();
   void set_description(const QString &nam);
   const QString &get_description() const;
   //UiError add(Primitive *prim);
   void add_exec(Primitive *prim);
   void finalize();
   UiError exec();
   UiError undo();
   void store_data(QDataStream &p_stream)const;
   void restore_data(RestoreStream &p_stream);
protected:
   QString description;
   PrimitiveList primitives;
private:
   Document *document;
   enum State {
      building,
      before,
      after
   } state;
};
#endif	/* _PRIMITIVEGROUP_H */
